import * as TYPE from './constants'

const initalState = {
  counter: 100,
}


function reducer(state = initalState, action) {
  switch (action.type) {
    case TYPE.INCREMNET:
      return { ...state, counter: state.counter + action.counter }
    
    case TYPE.DECREMENT:
      return { ...state, counter: state.counter - action.counter}
      
    default:
      return state;
  }
}

export default reducer